home *** CD-ROM | disk | FTP | other *** search
/ TPUG - Toronto PET Users Group / TPUG Users Group CD / TPUG Users Group CD.iso / C64 / U-Utilities / (c)u4.d64 / joy 2s8.c (.txt) < prev    next >
Commodore BASIC  |  2007-02-04  |  2KB  |  40 lines

  1. 0 REM**********************************      * MACHINE LANGUAGE JOYSTICK      *
  2. 1 REM* DECODER - COMMODORE 64 - 2S8   *      * READS JOYSTICK #2 + FIREBUTTON *
  3. 2 REM* STOP ACTION ----- 8 DIRECTIONS *      **********************************
  4. 3 REM**********************************      * BY ROGER D BURGE, #2667        *
  5. 4 REM* TORONTO PET USERS GROUP INC.   *      * TORONTO, CANADA                *
  6. 5 REM**********************************
  7. 10 POKE53280,1:POKE53281,6:PRINT"[147]        MACHINE LANGUAGE DECODER        ";
  8. 15 PRINT"                  #2S8                  ";SPC(11)"READS 8 DIRECTIONS
  9. 20 [153][166] 12)"BY ROGER D BURGE":[153][166]12)"FOR JOYSTICK # 2":[153]"READS JOYSTICK ";
  10. 25 [153]"AND RETURNS SCREEN      DIRECTIONAL VALUE ONLY IF STICK IS BEINGPUSHED.
  11. 40 PRINT"LINES 90 AND ON SHOULD BE INCLUDED IN  YOUR PROGRAM."
  12. 45 PRINT"THE USE OF VARIABLES IN LINE 100       INSTEAD OF REAL NUMBERS, EG. 252,";
  13. 50 PRINT"GREATLYSPEEDS UP THE ROUTINE.
  14. 55 [153]"WHEN THE ROUTINE IS CALLED THEN D2 =   THE DIRECTION GIVEN BY JOYSTICK ";
  15. 60 [153]"#2  AND FB = 1 IF THE FIRE BUTTON IS DOWN OR FB = 0 IF THE FIRE BUTTON IS ";
  16. 65 [153]"UP.":[153]"PRESS F1 TO TRY DECODER.":[153]"PRESS F3 TO LIST DECODER ROUTINE.
  17. 70 GETA$:IFA$="[133]"THENPRINT"[147]":GOTO90
  18. 75 IFA$="[134]"THENPRINT"[147]":LIST90-
  19. 80 GOTO70
  20. 90 GOSUB110:JS=820:F1=41:J2=253:B2=254
  21. 100 SYSJS:D2=F1-PEEK(J2):FB=PEEK(B2):PRINT"D2="D2"FB="FBCHR$(13)"[145]":GOTO100
  22. 110 FORT=820TO919:READA:POKET,A:NEXT:RETURN
  23. 120 DATA173,0,220,41,15
  24. 130 DATA201,7,208,5,162,40,56,176,65
  25. 135 DATA201,5,208,5,162,0,56,176,56
  26. 140 DATA201,13,208,5,162,1,56,176,47
  27. 145 DATA201,9,208,5,162,2,56,176,38
  28. 150 DATA201,11,208,5,162,42,56,176,29
  29. 155 DATA201,10,208,5,162,82,56,176,20
  30. 160 DATA201,14,208,5,162,81,56,176,11
  31. 165 DATA201,6,208,5,162,80,56,176,2
  32. 170 DATA162,41
  33. 175 DATA134,253
  34. 180 DATA173,0,220,41,16
  35. 190 DATA201,0,208,5,160,1,132,254,96
  36. 200 DATA160,0,132,254,96
  37. 210 REM**OMIT PRINT STATEMENTS IN                LINE 100
  38. 220 REM*BEFORE GAME ACTION STARTS,              POKE781,41:POKE 253,41
  39. 230 REM*THIS SUBROUTINE IS RELOCATABLE
  40.